//获取购物车列表接口
import instance from "@/utils/request";
export function getCartListData() {
    return instance({
        url: '/cart/list',
        method: 'get',
    })
}
interface checkedAllItem {
    type: boolean,
    userid: string
}
//更新所有购物车数据
export function setAllChecked(data: checkedAllItem) {
    return instance({
        url: '/cart/selectall',
        method: 'post',
        data,
        headers: {
            'Content-Type': 'application/json'
        }
    })
}
interface checkedOneItem {
    cartid: string,
    flag: boolean
}
//更新单个购物车数据
export function setOneChecked(data: checkedOneItem) {
    return instance({
        url: '/cart/selectone',
        method: 'post',
        data,
        headers: {
            'Content-Type': 'application/json'
        }
    })
}
//删除单个购物车数据
export function deleteCartData(data: {productIds:string}) {
    return instance({
        url: '/cart/remove',
        method: 'post',
        data,
        headers: {
            'Content-Type': 'application/json'
        }
    })
}